//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/.
// 			VisualNovelToolkit		     /_/_/_/_/_/.
// Copyright ©2013 - Sol-tribe.	/_/_/_/_/_/_/_/_/_/.
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/.

using UnityEngine;
using System.Collections;

/// <summary>
/// ViNo Config property is saved to PlayerPrefs.
/// </summary>
public class ViNoConfig {	
		
	/// <summary>
	/// Gets or sets the master text speed.
	/// </summary>
	/// <value>
	/// The master text speed.
	/// </value>	
	static public float prefsTextSpeed{
		get{			
			if( ! PlayerPrefs.HasKey( "textSpeed" ) ){
				PlayerPrefs.SetFloat( "textSpeed" , 1f );
				return 1f;
			}
			else{
				return PlayerPrefs.GetFloat( "textSpeed" );				
			}
		}
		set{
			PlayerPrefs.SetFloat( "textSpeed" , value );			
		}		
	}
	
	/// <summary>
	/// Gets or sets the prefs bgm volume.
	/// </summary>
	/// <value>
	/// The prefs bgm volume.
	/// </value>
	static public float prefsBgmVolume{ 
		get{			
			if( ! PlayerPrefs.HasKey( "bgmVol" ) ){
				PlayerPrefs.SetFloat( "bgmVol" , 1f );
				return 1f;
			}
			else{
				return PlayerPrefs.GetFloat( "bgmVol" );				
			}
		}
		set{
			PlayerPrefs.SetFloat( "bgmVol" , value );			
			if( ISoundPlayer.Instance != null ){
				ISoundPlayer.Instance.BGMVolumeChanged( value );
			}
		}			
	}
		
	/// <summary>
	/// Gets or sets the prefs se volume.
	/// </summary>
	/// <value>
	/// The prefs se volume.
	/// </value>
	static public float prefsSeVolume{ 
		get{			
			if( ! PlayerPrefs.HasKey( "seVol" ) ){
				PlayerPrefs.SetFloat( "seVol" , 1f );
				return 1f;
			}
			else{
				return PlayerPrefs.GetFloat( "seVol" );				
			}
		}
		set{
			PlayerPrefs.SetFloat( "seVol" , value );			
			if( ISoundPlayer.Instance != null ){
				ISoundPlayer.Instance.SEVolumeChanged( value );
			}
		}
	}	
	
	/// <summary>
	/// Gets or sets the prefs voice volume.
	/// </summary>
	/// <value>
	/// The prefs voice volume.
	/// </value>
	static public float prefsVoiceVolume{ 
		get{			
			if( ! PlayerPrefs.HasKey( "voiceVol" ) ){
				PlayerPrefs.SetFloat( "voiceVol" , 1f );
				return 1f;
			}
			else{
				return PlayerPrefs.GetFloat( "voiceVol" );				
			}
		}
		set{
			PlayerPrefs.SetFloat( "voiceVol" , value );			
			if( ISoundPlayer.Instance != null ){
				ISoundPlayer.Instance.VoiceVolumeChanged( value );
			}
		}			
	}			
	
}
